<template>
  <div class="cover">
    <img class="cover-image" src="../assets/images/cover-image.jpg" alt="">
    <div @click="start" class="start-btn"></div>
  </div>
</template>

<script type="text/ecmascript-6">
  import axios from 'axios'

  // start接口返回-1
  export default {
    name: 'cover',
    methods: {
      start(){
        if(!window.sessionStorage.startTime){
          window.sessionStorage.startTime = new Date().getTime();
        }
        axios.get('/gxtest/start').then(res=>{
          //start
          this.$router.push('exam')
        })

      }
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  .cover
    position: relative
    .cover-image
      width: 100%
    .start-btn
      position: absolute
      top: 80vw
      left: 50%
      width: 40vw
      height: 12vw
      transform: translate(-50%,-50%)
</style>
